package com.maila.sdk.demo;

import android.net.Uri;
import android.os.Bundle;
import android.view.KeyEvent;

import com.duiba.maila.sdk.WebPageView;

public class WebViewActivity extends BaseActivity {
    private WebPageView pageView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_web_view);
        pageView = (WebPageView) findViewById(R.id.web_content);
        Uri url = getIntent().getData();
        pageView.loadUrl(url.toString());
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (pageView.canGoBack()) {
            pageView.goBack();
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }
}
